package com.dotflat.photoAlbum.repository;


import com.dotflat.photoAlbum.domain.PhotoAlbumStaticTemplate;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface PhotoAlbumTemplateRepository extends JpaRepository<PhotoAlbumStaticTemplate, String>, JpaSpecificationExecutor<PhotoAlbumStaticTemplate> {

       @Query(value = "select * from tb_photo_album_static_template t" +
               " where (t.aid=?1 or t.aid is null) and (t.deleted=false or t.deleted is null) " +
               "order by visitor,created", nativeQuery = true)
       List<PhotoAlbumStaticTemplate> findAllByAreaId(String templateId);

}
